#!/usr/bin/env node

class TimerBomb {
    constructor() {
        this.timer = null;
    }

    start() {
        console.log('Bomb started. It will explode in 3 seconds.');
        this.timer = setTimeout(() => {
            console.log('BOOM! Explosion!');
        }, 3000);
    }

    clear() {
        console.log('Bomb cleared before explosion.');
        clearTimeout(this.timer);
    }
}

const b1 = new TimerBomb();
const b2 = new TimerBomb();


b1.start();

b2.start();

setTimeout(() => {
    b2.clear();
}, 1000);
